/**
 * Created by zahir on 2015/4/2.
 */

var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = Schema.ObjectId;

var OrderModel = new Schema({
    "FID":{type:ObjectId},
    "FBATCHID":{type:String},
    "FAUDITRESULTS":{type:Boolean,default:false},
    "FRENTMACHINEORDERNO":{type:String},//租机订单号
    "FCHANNELSORDERNO":{type:String},//渠道订单号
    "FPLACEORDERTIME":{type:Date},//下单时间
    "FORDERSTATUS":{type:String},//订单状态
    "FORDERREAMK1":{type:String},//备注1 2 3 4
    "FORDERREAMK2":{type:String},
    "FORDERREAMK3":{type:String},
    "FORDERREAMK4":{type:String},
    "FTAKEAWAYTIME":{type:Date},//取机时间
    "FCANCELDESCRIPTION":{type:String},//取消描述

    "FDEVICEQUANTITY":{type:Number},//用户租用设备数量

    "FPAYMENTMETHOD":{type:String},//支付方式
    "FPROMOTIONCODE":{type:String},//优惠码
    "FLEASEBEGINTIME":{type:Date},//出境日期
    "FLEASEENDTIME":{type:Date},//入境日期
    "FLEASEDAYNUMBER":{type:String},//租借天数
    "FDESTINATION":{type:String},//目的地
    "FUNITPRICE":{type:Number},//每日单价
    "FEXPECTEDRENT":{type:Number},//预计租金
    "FACTUALRENT":{type:Number},//实际总费用
    "FTOTALRENT":{type:Number},//总费用

    "FRENEWAL":{type:Boolean},//是否续租
    "FRENEWALTIME":{type:String},//是否续租

    "FACCOUNTS":{type:String},//漫游包帐号

    "FCHANNELCOMPAYNAME":{type:String},//渠道公司名称
    "FCHANNELNO":{type:String},//渠道编号
    "FDELIVERYWAY":{type:String},//交货方式

    "FRECEIVEADDRESS":{type:String},//漫游包送达地点
    "FEXPRESSCOMPANY":{type:String},//快递公司
    "FEXPRESSNO":{type:String},//快递单号
    "FEXPRESSPICKUPTIME":{type:Date},//快递取货日期
    "FEXPRESSSERVICETIME":{type:Date},//快递送达日期

    "FEXPRESSRECIPIENT":{type:String},//快递收件人
    "FEXPRESSRECIPIENTTEL":{type:String},//快递收件人号码
    "FRESTITUTIONADDRESS":{type:String},//返还地址
    "FFOREGIFT":{type:Number},//押金
    "FCURRENCY":{type:String},//货币类型
    "FFOREGIFTSTATUS":{type:String},//押金状态

    "FPROCESSINGMODE":{type:String},//处理方式
    "FDEDUCTFOREGIFT":{type:Number},//扣押金
    "FDEDUCTFOREGIFTDESCRIPTION":{type:String},//扣押金说明
    "FDEDUCTFOREGIFTTIME":{type:Date},//扣押金时间
    "FDEVICELIST":[{
        "FSN":{type:String},//SN
        "FSKYROAMID":{type:String},//漫游包ID
        "FSKU":{type:String},//SKU
        "FDEVICETYPE":{type:String},//设备类型 型号
        "FCHECKEDSTATUS":{type:String},//校验状态
        "FEXWAREHOUSETIME":{type:Date},//出库时间 自动生成
        "FINWAREHOUSETIME":{type:Date}//入库时间  自动生成
    }]
});



mongoose.model('tab_order', OrderModel);